package com.gpoint.rdp.web.servlet;

import java.io.IOException;

import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.gpoint.rdp.base.web.util.RequestViewUtil;

//@WebServlet(name="action",urlPatterns="*.htm") 
public class GpiontServlet extends HttpServlet{
	
	 @Override
	    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	        System.out.println("===========doGet====================");
	        doPost(req, resp);
	    }

	    @Override
	    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//	    	if(request.isRequestedSessionIdValid()){
				String jspPath = RequestViewUtil.getViewUrl(request);
				request.getRequestDispatcher("/WEB-INF/view" + jspPath).forward(request, response);
				request.setAttribute("contextPath", "http://127.0.0.1:8083/");
//			}
	    }

	    @Override
	    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	        super.service(req, resp);
	    }

	    @Override
	    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
	        super.service(req, res);
	    }
}
